package org.hxzon.tapestry5.components;

import org.apache.tapestry5.MarkupWriter;
import org.hxzon.tapestry5.components.base.AbstractTextFieldEx;

//copy form PasswordField
public class PasswordFieldEx extends AbstractTextFieldEx {
    @Override
    protected final void writeFieldTag(MarkupWriter writer, String value) {
        writer.element("input",

        "type", "password",

        "name", getControlName(),

        "id", getClientId(),

        "value", "",

        "size", getWidth());
    }

    final void afterRender(MarkupWriter writer) {
        writer.end(); // input
    }

    /**
     * Returns true, blank input should be ignored and not cause an update to the server-side property bound to the
     * value parameter.
     *
     * @return true
     */
    @Override
    protected boolean ignoreBlankInput() {
        return true;
    }
}
